package ms.unicorn.ui.figures;

import ms.unicorn.ui.borders.RoundedSchemeBorder;

import org.eclipse.draw2d.Graphics;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;

public class EntityRoundRectangle extends NodeFigure {
	
	private RoundedSchemeBorder border;
	private Theme theme;
	
	public EntityRoundRectangle() {
		setBorder(border = new RoundedSchemeBorder());
		setTheme(new Theme());
		getTheme().setFigure(this);
		border.setTheme(getTheme());
	}
	
	@Override
    protected void paintFigure(Graphics graphics) {
        paintShadow(graphics);
    }

    protected void paintShadow(Graphics graphics) {
        super.paintBorder(graphics);
    }

    @Override
    protected void paintBorder(Graphics graphics) {
        //do nothing. we paint the border before the rest of the figure as it is where we paint the shadow.
    }

	public Theme getTheme() {
		return theme;
	}

	public void setTheme(Theme theme) {
		this.theme = theme;
	}
}
